import java.util.*;
public class 844 {
    
        public boolean backspaceCompare(String S, String T) {
            return build(S).equals(build(T));
        }
    
        public String build(String str) {
            StringBuffer ret = new StringBuffer();
            int length = str.length();
            for (int i = 0; i < length; ++i) {
                char ch = str.charAt(i);
                if (ch != '#') {
                    ret.append(ch);
                } else {
                    if (ret.length() > 0) {
                        ret.deleteCharAt(ret.length() - 1);
                    }
                }
            }
            return ret.toString();
        }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String a= new String();
        a=in.nextLine();
        String b = new String();
        b=in.nextLine();
        System.out.println();
        844 c= new 844();

    }
}
